package com.ebocy.hammer.battle.fight.message;

import com.ebocy.hammer.core.constants.GameMessageCode;
import com.ebocy.hammer.core.message.AbstractS2CMessage;

public class S2CMoveMessage extends AbstractS2CMessage{
	private String playerId;
	public String getPlayerId() {
		return playerId;
	}

	public short getX() {
		return x;
	}

	public short getY() {
		return y;
	}

	public byte getDir() {
		return dir;
	}

	private short x;
	private short y;
	private byte dir;

	public S2CMoveMessage(String playerId, short x, short y, byte dir) {
		this.playerId = playerId;
		this.x = x;
		this.y = y;
		this.dir = dir;
	}

	@Override
	protected void writeMessage() {
		writeString(playerId);
		writeShort(x);
		writeShort(y);
		writeByte(dir);
//		writeLong(currentTime);
	}

	@Override
	public short getMessageCode() {
		return GameMessageCode.BATTLE_MOVE;
	}

}
